<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root>
	<fo:layout-master-set>
		<fo:simple-page-master master-name="response" margin-bottom="1cm" margin-left="10mm" margin-top="10mm" margin-right="1cm" page-height="297mm" page-width="210mm">
			<fo:region-body margin-top="80mm" margin-bottom="10mm"></fo:region-body>
			<fo:region-before extent="1mm"></fo:region-before>
			<fo:region-after extent="2mm" margin-bottom="1mm" margin-right="5mm"></fo:region-after>
		</fo:simple-page-master>
	</fo:layout-master-set>
	
	<fo:page-sequence master-reference="response">
		<fo:title>Response</fo:title>
		
		<fo:static-content flow-name="xsl-region-after">
			<fo:block xsl:use-attribute-sets="page">Page<fo:page-number></fo:page-number></fo:block>
		</fo:static-content>		
		<!-- Titolo della pagina-->
		<fo:static-content flow-name="xsl-region-before">
			<fo:block-container xsl:use-attribute-sets="border-style" border-width="2mm" height="60mm" width="190mm" top="2mm" padding=".6mm" position="absolute">
			<fo:block text-align="center">
			<fo:external-graphic src="url(http://ltw0807.web.cs.unibo.it/df/pdf/img/slide-tigelle.jpg)"></fo:external-graphic>
			</fo:block>
			<fo:block text-align="end" font-style="oblique">
			by Power Chiosco
			</fo:block>
			</fo:block-container>
			<fo:block-container margin-top="70mm" height="200mm" border-width="1.5mm" width="190mm" padding="1.5mm" xsl:use-attribute-sets="border" background-image="url(http://ltw0807.web.cs.unibo.it/df/pdf/img/response.png)">
				<fo:block></fo:block>
			</fo:block-container>
		</fo:static-content>
		
		<!-- Body -->
		<fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="recolor">
			<xsl:for-each select="/dati/response//metadati">
			<fo:block>
				<xsl:variable name="satana"><xsl:value-of select="expression/eidentifier"></xsl:value-of></xsl:variable>
				<fo:basic-link external-destination="{$satana}"  xsl:use-attribute-sets="link-text">
				<fo:inline xsl:use-attribute-sets="retitle"><xsl:value-of select="expression/etitle"></xsl:value-of></fo:inline></fo:basic-link>
				<fo:inline font-size="10pt" white-space-treatment="preserve" text-indent="10pt"> written by </fo:inline>
				<fo:inline xsl:use-attribute-sets="recreator"><xsl:value-of select="expression/ecreator"></xsl:value-of></fo:inline>
			</fo:block>
			<fo:block >
				<fo:inline xsl:use-attribute-sets="redescription">"<xsl:value-of select="expression/edescription"></xsl:value-of>"</fo:inline>
				<fo:inline xsl:use-attribute-sets="redate"> | <xsl:value-of select="expression/edate"></xsl:value-of></fo:inline>
				
			</fo:block>
			<fo:block>
				<fo:inline font-size="10pt"> from </fo:inline>
				<fo:inline font-size="16pt" font-weight="300"><xsl:value-of select="work/wtitle"></xsl:value-of></fo:inline>
				<fo:inline font-size="10pt"> written by </fo:inline>
				<fo:inline font-size="16pt"><xsl:value-of select="work/wcreator"></xsl:value-of></fo:inline>
			</fo:block>
			<!--Separatore fra responses -->
			<fo:list-block>
				<fo:list-item xsl:use-attribute-sets="separator">
					<fo:list-item-label>
						<fo:block></fo:block>
					</fo:list-item-label>
				<fo:list-item-body padding="0mm">
					<fo:block  background-color="inherited-property-value(color)" font-size="26pt">*-*</fo:block>
				</fo:list-item-body>
			  </fo:list-item>
			</fo:list-block>
		</xsl:for-each>		
		</fo:flow>
	</fo:page-sequence>
</fo:root>

</xsl:template>
</xsl:stylesheet>
